package org.state;

public class Client {
	public static void main(String[] args) {
		Context context = new Context();
		context.setCurrentState(new StateA());
		// 状态的转换A-B-C-D;
		System.out.println("---------------A-B-C-D--------------");
		context.MethodA();
		context.MethodB();
		context.MethodC();
		context.MethodD();
		// 由于A不能直接转化为C，所以后面的没有执行
		System.out.println("---------------A-C-D---------------");
		context.setCurrentState(new StateA());
		context.MethodA();
		context.MethodC();
		context.MethodD();
		// 状态的转换B-D-A;
		System.out.println("---------------B-D-A---------------");
		context.setCurrentState(new StateA());
		context.MethodB();
		context.MethodD();
		context.MethodA();
	}

}
